package com.imike.akka;

import static akka.dispatch.Futures.future;

import java.util.concurrent.Callable;

import scala.concurrent.Future;
import akka.actor.ActorSystem;

public class HelloWorld {

    public static void main(String[] args) throws Exception {
        
        ActorSystem system = ActorSystem.create("MySystem");
        
        Future<String> f = future(new Callable<String>() {
            public String call() {
              return "Hello" + "World";
            }
          }, system.dispatcher());
           
          f.onSuccess(new PrintResult<String>("lindi"), system.dispatcher());

          System.out.println("sleep...");
          Thread.sleep(2000);
          System.out.println("sleep end");
          
          system.shutdown();
    }


}
